package com.tian.service.impl;

import com.tian.message.DelayDeleteCacheMessage;
import com.tian.service.DelayDeleteCacheService;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * {@code @description:} TODO
 *
 * @author tianwc 公众号：Java后端技术全栈
 * 在线刷题 1200+java面试题和1000+篇技术文章：<a href="https://woaijava.cc/">博客地址</a>
 * {@code @date:} 2025-03-02 16:09
 * {@code @version:} 1.0
 */
@Service
public class DelayDeleteCacheServiceImpl implements DelayDeleteCacheService {
    @Resource
    private RedissonClient redissonClient;
    @Override
    public void delayDeleteCache(DelayDeleteCacheMessage delayDeleteCacheMessage) {
        redissonClient.getBucket(delayDeleteCacheMessage.getCacheKey()).delete();
    }
}
